<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->notNull()->default('')->comment('管理员名称');
            $table->string('password')->notNull()->default('')->comment('管理员密码');
            $table->string('head_image')->notNull()->default('')->comment('头像');
            $table->string('salt')->notNull()->default('')->comment('salt');
            $table->integer('role_id')->notNull()->default(0)->comment('角色id');
            $table->string('email')->notNull()->default('')->comment('管理员邮箱');
            $table->string('mobile')->notNull()->default('')->comment('管理员电话');
            $table->tinyInteger('status')->notNull()->default(0)->comment('0 正常   1 禁用');
            $table->string('ip')->notNull()->default('')->comment('上次登录的ip');
            $table->string('remember_token')->notNull()->default('')->comment('登录token');
            $table->integer('stu_id')->notNull()->default(0)->comment('关联stus表id');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
